//  data_range.h
//
//  Copyright 2011 AzureSky <AzureSky.fedora@gmail.com>
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//  MA 02110-1301, USA.
//
//

#ifndef DATA_RANGE_H_
#define DATA_RANGE_H_

namespace as
{

template <typename T>
class data_range
{
public:
    data_range(const T& min, const T& max) :
        _min_data(min),
        _max_data(max) {}

    data_range() :
        _min_data(),
        _max_data() {}

    ~data_range() {}

    inline T get_min() const {return _min_data;}
    inline T get_max() const {return _max_data;}

    inline void set_range(const T& min, const T& max) {
        _min_data = min;
        _max_data = max;
    }

    inline bool is_in_range(const T& value) const {
        return ((value >= get_min()) && (value <= get_max()));
    }

private:
    T _min_data;
    T _max_data;
};

} // namespace as

#endif /* DATA_RANGE_H_ */
